import { IsString, IsEnum, IsOptional, IsInt, Min } from 'class-validator';
import { ApiProperty } from '@nestjs/swagger';

export class QuerySemesterDto {
    @ApiProperty({ description: '学期名称', required: false })
    @IsString()
    @IsOptional()
    name?: string;

    @ApiProperty({ 
        description: '学期状态', 
        enum: ['planned', 'current', 'completed'],
        required: false
    })
    @IsEnum(['planned', 'current', 'completed'])
    @IsOptional()
    status?: string;

    @ApiProperty({ description: '页码', required: false, default: 1 })
    @IsInt()
    @Min(1)
    @IsOptional()
    page?: number = 1;

    @ApiProperty({ description: '每页数量', required: false, default: 10 })
    @IsInt()
    @Min(1)
    @IsOptional()
    pageSize?: number = 10;
} 